var obj = {
    name: 'dusehnyan',
    age: 12
}

var cl = console.log;
// cl(Object.values(obj))
// cl(Object.getOwnPropertyDescriptors(obj))


// cl(new Date().toLocaleDateString())
// cl(new Date().toLocaleTimeString())

function leftDays() {
    var today = new Date();
    var endYear = new Date(today.getFullYear(), 11, 31, 23, 59, 59, 999);
    var msPerDay = 24 * 60 * 60 * 1000;
    return Math.round((endYear.getTime() - today.getTime()) / msPerDay);
}

var Func = function (page) {
    // 'use stick';
    // 调用new关键字 new.target返回当前对象 反之underfined
    if (!new.target) {
        throw new Error('使用New关键字')
    }
    // taget
    // console.log(new.target == this) //false
    // console.log(new.target == Func) //true
    this._page = page
    this.sayName = function () {
        return this._page
    }

    return {}
}
var news = new Func(1000);
cl("返回对象" + (new Func()) === {})
// cl(news instanceof Func)
// cl(news._page)
// cl(Func()._page)